import request from "@/utils/request";

export const getAddressListAPI = (userId) => {
    return request({
        url: `/mall-user/member/address/list/${userId}`,
        method: 'GET',
    })
}

export const deleteAddressAPI = (id) => {
    return request({
        url: `/mall-user/member/address/delete/${id}`,
        method: 'DELETE'
    })
}

export const setDefaultAddressAPI = (id) => {
    return request({
        url: `/mall-user/member/address/setDefault/${id}`,
        method: 'Get'
    })
}

export const updateAddressAPI  = (data) => {
    return request({
        url: `/mall-user/member/address/update`,
        method: 'POST',
        data: data
    })
}

// 统一地区接口处理
export const getRegionChildrenAPI = (parentCode) => {
    return request({
        url: '/mall-user/region/children',
        method: 'GET',
        params: { parentCode }
    })
}
